using SqlSugar;

/*
 * @author : xkdong@163.com
 * @date : 2024-3-15
 * @desc : 病人档案表
 */
namespace YOUYOU.Models.Entities.DBModels
{
    /// <summary>
    /// 病人档案表
    /// </summary>
    [SugarTable("record_patientrecords", TableDescription = "病人档案表")]
    public class RecordPatientrecords
    {
        /// <summary>
        /// ID
        /// </summary>
        [SugarColumn(ColumnName = "ID", IsIdentity = true, IsPrimaryKey = true)]
        public int ID { get; set; }

        /// <summary>
        /// 患者ID
        /// </summary>
        [SugarColumn(ColumnName = "PatientId")]
        public string PatientId { get; set; }

        /// <summary>
        /// 患者姓名
        /// </summary>
        [SugarColumn(ColumnName = "FullName")]
        public string FullName { get; set; }

        /// <summary>
        /// 姓名简拼
        /// </summary>
        [SugarColumn(ColumnName = "InputCode")]
        public string? InputCode { get; set; }

        /// <summary>
        /// 民族
        /// </summary>
        [SugarColumn(ColumnName = "Nation")]
        public int? Nation { get; set; }

        //[Navigate(NavigateType.OneToOne, nameof(Nation), nameof(DictBasedict.ID))]
        //public DictBasedict NationInfo { get; set; }

        /// <summary>
        /// 性别
        /// </summary>
        [SugarColumn(ColumnName = "Sex")]
        public int? Sex { get; set; }


        //[Navigate(NavigateType.OneToOne, nameof(Sex), nameof(DictBasedict.ID))]
        //public DictBasedict SexInfo { get; set; }

        /// <summary>
        /// 出生日期
        /// </summary>
        [SugarColumn(ColumnName = "Birth")]
        public DateTime Birth { get; set; }

        /// <summary>
        /// 联系电话
        /// </summary>
        [SugarColumn(ColumnName = "Number")]
        public string? Number { get; set; }

        /// <summary>
        /// 电子邮件地址
        /// </summary>
        [SugarColumn(ColumnName = "Email")]
        public string? Email { get; set; }

        /// <summary>
        /// 地址
        /// </summary>
        [SugarColumn(ColumnName = "Address")]
        public string? Address { get; set; }
        /// <summary>
        /// 地址详情
        /// </summary>
        [SugarColumn(ColumnName = "AddressDetile")]
        public string? AddressDetile { get; set; }
        /// <summary>
        /// 初步诊断
        /// </summary>
        [SugarColumn(ColumnName = "Diagnosis")]
        public string? Diagnosis { get; set; }

        /// <summary>
        /// 已开处方药物
        /// </summary>
        [SugarColumn(ColumnName = "MedicAtions")]
        public string? MedicAtions { get; set; }

        /// <summary>
        /// 病史
        /// </summary>
        [SugarColumn(ColumnName = "MedicalHistory")]
        public string? MedicalHistory { get; set; }

        /// <summary>
        /// 最近就诊日期
        /// </summary>
        [SugarColumn(ColumnName = "LastVisitDate")]
        public DateTime? LastVisitDate { get; set; }

        /// <summary>
        /// 下次就诊日期
        /// </summary>
        [SugarColumn(ColumnName = "NextVisitDate")]
        public DateTime? NextVisitDate { get; set; }

        /// <summary>
        /// 血压
        /// </summary>
        [SugarColumn(ColumnName = "BloodRessure")]
        public string? BloodRessure { get; set; }

        /// <summary>
        /// 体重
        /// </summary>
        [SugarColumn(ColumnName = "Weight")]
        public decimal Weight { get; set; }

        /// <summary>
        /// 身高
        /// </summary>
        [SugarColumn(ColumnName = "Height")]
        public decimal Height { get; set; }

        /// <summary>
        /// 身份证号码
        /// </summary>
        [SugarColumn(ColumnName = "IdCard")]
        public string IdCard { get; set; }

        /// <summary>
        /// 邮政编码
        /// </summary>
        [SugarColumn(ColumnName = "PostalCode")]
        public string? PostalCode { get; set; }

        /// <summary>
        /// 紧急联系人姓名
        /// </summary>
        [SugarColumn(ColumnName = "EmergencyContactName")]
        public string? EmergencyContactName { get; set; }

        /// <summary>
        /// 紧急联系人电话
        /// </summary>
        [SugarColumn(ColumnName = "EmergencyContactNumber")]
        public string? EmergencyContactNumber { get; set; }

        /// <summary>
        /// 紧急联系人关系
        /// </summary>
        [SugarColumn(ColumnName = "EmergencyContactRelationship")]
        public string? EmergencyContactRelationship { get; set; }

        /// <summary>
        /// 疾病编码
        /// </summary>
        [SugarColumn(ColumnName = "DiseaseCode")]
        public string? DiseaseCode { get; set; }



        /// <summary>
        /// 创建时间
        /// </summary>
        [SugarColumn(ColumnName = "createDate")]
        public DateTime createDate { get; set; }

        /// <summary>
        /// 婚姻情况
        /// </summary>
        [SugarColumn(ColumnName = "MaritalStatus")]
        public int? MaritalStatus { get; set; }

        //[Navigate(NavigateType.OneToOne, nameof(MaritalStatus), nameof(DictBasedict.ID))]
        //public DictBasedict MaritalStatusInfo { get; set; }

        /// <summary>
        /// 教育程度
        /// </summary>
        [SugarColumn(ColumnName = "EducationDegree")]
        public string? EducationDegree { get; set; }
        //
        //[Navigate(NavigateType.OneToOne, nameof(EducationDegree), nameof(DictBasedict.ID))]
        //public DictBasedict EducationDegreeInfo { get; set; }

        /// <summary>
        /// 职业
        /// </summary>
        [SugarColumn(ColumnName = "Occupation")]
        public string? Occupation { get; set; }

        //[Navigate(NavigateType.OneToOne, nameof(Occupation), nameof(DictBasedict.ID))]
        //public DictBasedict OccupationInfo { get; set; }

        /// <summary>
        /// 家族病史
        /// </summary>
        [SugarColumn(ColumnName = "FamilyHistory")]
        public string? FamilyHistory { get; set; }

        /// <summary>
        /// 药物过敏史
        /// </summary>
        [SugarColumn(ColumnName = "DrugAllergyHistory")]
        public string? DrugAllergyHistory { get; set; }

        /// <summary>
        /// 病人类型 1--门诊   2--住院
        /// </summary>
        [SugarColumn(ColumnName = "PatientClass")]
        public int? PatientClass { get; set; }

        /// <summary>
        /// 病人确认状态  1--未确认  2--已确认未入组  3--已入组 4 终止随访
        /// </summary>
        [SugarColumn(ColumnName = "PatientConfirmStatus")]
        public int? PatientConfirmStatus { get; set; }

        /// <summary>
        /// 病人标签
        /// </summary>
        [SugarColumn(ColumnName = "Tags")]
        public string? Tage { get; set; }
        /// <summary>
        /// 病人人群，1.一般人群 2.高危人群 3.慢病人群
        /// </summary>
        public int CrowdCategory { get; set; }
        ///// <summary>
        ///// 慢病分组
        ///// </summary>
        //public string ChronicGrouping {  get; set; }
        /// <summary>
        /// 科室代码
        /// </summary>
        public string DeptCode { get; set; }
        /// <summary>
        /// 慎访（0：正常，1：慎访）
        /// </summary>
        [SugarColumn(ColumnName = "Visitcarefully")]
        public int Visitcarefully { get; set; }
        /// <summary>
        /// 腰围
        /// </summary>
        [SugarColumn(ColumnName = "Waistline")]
        public int? Waistline {  get; set; }
      
        /// <summary>
        ///0.啥也不是1.高血压2.糖尿病3.冠心病4.慢阻肺5.脑卒中6.慢性肾病
        /// </summary>
        public string? HighRisk {  get; set; }
        /// <summary>
        /// 纳管医生
        /// </summary>
        public string? NaguanDoctor {  get; set; }
        /// <summary>
        /// 转诊科室
        /// </summary>
        public string? ReferralDept {  get; set; }

        //[Navigate(NavigateType.OneToMany, nameof(PatientId), nameof(SiftManager.PatientId))]
        //public List<SiftManager> siftManagers { get; set; }

       // [Navigate(NavigateType.OneToMany, nameof(PatientId), nameof(RecordEnrollment.PatientId))]
        //public List<RecordEnrollment> enrollments { get; set; }

        //
        //[Navigate(NavigateType.OneToMany, nameof(FollowHypertensionfollowup.PatientID), nameof(PatientId))]
        //public List<FollowHypertensionfollowup>? hypertensionfollowups { get; set; }

        ////[Navigate(NavigateType.OneToOne, nameof(PatientId), nameof(SiftPrimaryScreening.Patientid))]
        //public SiftPrimaryScreening? sift { get; set; }

        //[Navigate(NavigateType.OneToMany, nameof(ManagementLifestyle.Patientid), nameof(PatientId))]
        ////[Navigate(NavigateType.Dynamic, "[{m:\"PatientId\",c:\"Patientid\"}]")]
        ////[Navigate(NavigateType.OneToOne, nameof(PatientId), nameof(ManagementLifestyle.Patientid))]
        //public List<ManagementLifestyle>? manag { get; set; }
    }



    public class RecordPatientrecordsg
    {
        /// <summary>
        /// ID
        /// </summary>
        [SugarColumn(ColumnName = "ID", IsIdentity = true, IsPrimaryKey = true)]
        public int ID { get; set; }

        /// <summary>
        /// 患者ID
        /// </summary>
        [SugarColumn(ColumnName = "PatientId")]
        public string PatientId { get; set; }

        /// <summary>
        /// 患者姓名
        /// </summary>
        [SugarColumn(ColumnName = "FullName")]
        public string FullName { get; set; }

        /// <summary>
        /// 姓名简拼
        /// </summary>
        [SugarColumn(ColumnName = "InputCode")]
        public string? InputCode { get; set; }

        /// <summary>
        /// 民族
        /// </summary>
        [SugarColumn(ColumnName = "Nation")]
        public int? Nation { get; set; }

        /// <summary>
        /// 性别
        /// </summary>
        [SugarColumn(ColumnName = "Sex")]
        public string? Sex { get; set; }

        /// <summary>
        /// 出生日期
        /// </summary>
        [SugarColumn(ColumnName = "Birth")]
        public DateTime? Birth { get; set; }

        /// <summary>
        /// 联系电话
        /// </summary>
        [SugarColumn(ColumnName = "Number")]
        public string? Number { get; set; }

        /// <summary>
        /// 电子邮件地址
        /// </summary>
        [SugarColumn(ColumnName = "Email")]
        public string? Email { get; set; }

        /// <summary>
        /// 地址
        /// </summary>
        [SugarColumn(ColumnName = "Address")]
        public string? Address { get; set; }
        /// <summary>
        /// 地址详情
        /// </summary>
        [SugarColumn(ColumnName = "AddressDetile")]
        public string? AddressDetile { get; set; }
        /// <summary>
        /// 初步诊断
        /// </summary>
        [SugarColumn(ColumnName = "Diagnosis")]
        public string? Diagnosis { get; set; }

        /// <summary>
        /// 已开处方药物
        /// </summary>
        [SugarColumn(ColumnName = "MedicAtions")]
        public string? MedicAtions { get; set; }

        /// <summary>
        /// 病史
        /// </summary>
        [SugarColumn(ColumnName = "MedicalHistory")]
        public string? MedicalHistory { get; set; }

        /// <summary>
        /// 最近就诊日期
        /// </summary>
        [SugarColumn(ColumnName = "LastVisitDate")]
        public string? LastVisitDate { get; set; }

        /// <summary>
        /// 下次就诊日期
        /// </summary>
        [SugarColumn(ColumnName = "NextVisitDate")]
        public string? NextVisitDate { get; set; }

        /// <summary>
        /// 血压
        /// </summary>
        [SugarColumn(ColumnName = "BloodRessure")]
        public string? BloodRessure { get; set; }

        /// <summary>
        /// 体重
        /// </summary>
        [SugarColumn(ColumnName = "Weight")]
        public decimal? Weight { get; set; }

        /// <summary>
        /// 身高
        /// </summary>
        [SugarColumn(ColumnName = "Height")]
        public decimal? Height { get; set; }

        /// <summary>
        /// 身份证号码
        /// </summary>
        [SugarColumn(ColumnName = "IdCard")]
        public string? IdCard { get; set; }

        /// <summary>
        /// 邮政编码
        /// </summary>
        [SugarColumn(ColumnName = "PostalCode")]
        public string? PostalCode { get; set; }

        /// <summary>
        /// 紧急联系人姓名
        /// </summary>
        [SugarColumn(ColumnName = "EmergencyContactName")]
        public string? EmergencyContactName { get; set; }

        /// <summary>
        /// 紧急联系人电话
        /// </summary>
        [SugarColumn(ColumnName = "EmergencyContactNumber")]
        public string? EmergencyContactNumber { get; set; }

        /// <summary>
        /// 紧急联系人关系
        /// </summary>
        [SugarColumn(ColumnName = "EmergencyContactRelationship")]
        public string? EmergencyContactRelationship { get; set; }

        /// <summary>
        /// 疾病编码
        /// </summary>
        [SugarColumn(ColumnName = "DiseaseCode")]
        public string? DiseaseCode { get; set; }



        /// <summary>
        /// 创建时间
        /// </summary>
        [SugarColumn(ColumnName = "createDate")]
        public DateTime? createDate { get; set; }

        /// <summary>
        /// 婚姻情况
        /// </summary>
        [SugarColumn(ColumnName = "MaritalStatus")]
        public int? MaritalStatus { get; set; }

        /// <summary>
        /// 教育程度
        /// </summary>
        [SugarColumn(ColumnName = "EducationDegree")]
        public string? EducationDegree { get; set; }


        /// <summary>
        /// 职业
        /// </summary>
        [SugarColumn(ColumnName = "Occupation")]
        public string? Occupation { get; set; }


        /// <summary>
        /// 家族病史
        /// </summary>
        [SugarColumn(ColumnName = "FamilyHistory")]
        public string? FamilyHistory { get; set; }

        /// <summary>
        /// 药物过敏史
        /// </summary>
        [SugarColumn(ColumnName = "DrugAllergyHistory")]
        public string? DrugAllergyHistory { get; set; }

        /// <summary>
        /// 病人类型 1--门诊   2--住院
        /// </summary>
        [SugarColumn(ColumnName = "PatientClass")]
        public string? PatientClass { get; set; } //int

        /// <summary>
        /// 病人确认状态  1--未确认  2--已确认未入组  3--已入组 4 终止随访
        /// </summary>
        [SugarColumn(ColumnName = "PatientConfirmStatus")]
        public int? PatientConfirmStatus { get; set; }

        /// <summary>
        /// 病人标签
        /// </summary>
        [SugarColumn(ColumnName = "Tags")]
        public string? Tage { get; set; }
        /// <summary>
        /// 病人人群，1.一般人群 2.高危人群 3.慢病人群
        /// </summary>
        public int? CrowdCategory { get; set; }
        ///// <summary>
        ///// 慢病分组
        ///// </summary>
        //public string ChronicGrouping {  get; set; }
        /// <summary>
        /// 科室代码
        /// </summary>
        public string DeptCode { get; set; }
        /// <summary>
        /// 慎访（0：正常，1：慎访）
        /// </summary>
        [SugarColumn(ColumnName = "Visitcarefully")]
        public string? Visitcarefully { get; set; } //int
        /// <summary>
        /// 腰围
        /// </summary>
        [SugarColumn(ColumnName = "Waistline")]
        public int? Waistline { get; set; }

        /// <summary>
        ///0.啥也不是1.高血压2.糖尿病3.冠心病4.慢阻肺5.脑卒中6.慢性肾病
        /// </summary>
        public string? HighRisk { get; set; }
        /// <summary>
        /// 纳管医生
        /// </summary>
        public string? NaguanDoctor { get; set; }
        /// <summary>
        /// 转诊科室
        /// </summary>
        public string? ReferralDept { get; set; }
        public string? enrollments { get; set; }

        
    }
}

